/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package ru.ibrae.mchs.radiation.entities;

import java.io.Serializable;
import java.util.Set;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;

/**
 *
 * @author murr
 */
@Entity
@Table(name = "pokazatel", uniqueConstraints = {
    @UniqueConstraint(columnNames = {"ID_P"})})
@NamedQueries({
    @NamedQuery(name = "Pokazatel.findAll", query = "SELECT p FROM Pokazatel p"),
    @NamedQuery(name = "Pokazatel.findByIdP", query = "SELECT p FROM Pokazatel p WHERE p.idP = :idP"),
    @NamedQuery(name = "Pokazatel.findByPokazatel", query = "SELECT p FROM Pokazatel p WHERE p.pokazatel = :pokazatel"),
    @NamedQuery(name = "Pokazatel.findByParametr", query = "SELECT p FROM Pokazatel p WHERE p.parametr = :parametr"),
    @NamedQuery(name = "Pokazatel.findByShortPok", query = "SELECT p FROM Pokazatel p WHERE p.shortPok = :shortPok")})
public class Pokazatel implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "ID_P", nullable = false)
    private Integer idP;
    @Basic(optional = false)
    @Column(name = "POKAZATEL", nullable = false, length = 254)
    private String pokazatel;
    @Column(name = "PARAMETR")
    private Boolean parametr;
    @Basic(optional = false)
    @Column(name = "SHORT_POK", nullable = false, length = 20)
    private String shortPok;
    @OneToMany(mappedBy = "pokazatel")
    private Set<Result> resultSet;

    public Pokazatel() {
    }

    public Pokazatel(Integer idP) {
        this.idP = idP;
    }

    public Pokazatel(Integer idP, String pokazatel, String shortPok) {
        this.idP = idP;
        this.pokazatel = pokazatel;
        this.shortPok = shortPok;
    }

    public Integer getIdP() {
        return idP;
    }

    public void setIdP(Integer idP) {
        this.idP = idP;
    }

    public String getPokazatel() {
        return pokazatel;
    }

    public void setPokazatel(String pokazatel) {
        this.pokazatel = pokazatel;
    }

    public Boolean getParametr() {
        return parametr;
    }

    public void setParametr(Boolean parametr) {
        this.parametr = parametr;
    }

    public String getShortPok() {
        return shortPok;
    }

    public void setShortPok(String shortPok) {
        this.shortPok = shortPok;
    }

    public Set<Result> getResultSet() {
        return resultSet;
    }

    public void setResultSet(Set<Result> resultSet) {
        this.resultSet = resultSet;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idP != null ? idP.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Pokazatel)) {
            return false;
        }
        Pokazatel other = (Pokazatel) object;
        if ((this.idP == null && other.idP != null) || (this.idP != null && !this.idP.equals(other.idP))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "JPAtest.entities.Pokazatel[idP=" + idP + "]";
    }

}
